package bancosys.tec.persist.entities.domain.inheritance;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Inheritance;
import javax.persistence.InheritanceType;
import javax.persistence.Table;

import jmine.tec.persist.annotation.Alias;
import bancosys.tec.component.Documentation;
import bancosys.tec.persist.authorization.annotation.DisplayName;
import bancosys.tec.persist.bussobj.AuthPersistableBusinessObject;

/**
 * @author piercio
 */
@Entity
@Table(name = "PAI_JOINED")
@Inheritance(strategy = InheritanceType.JOINED)
@Alias("PJOIN1")
@Documentation("Entidade pai abstrato com joined.")
public abstract class PaiJoined extends AuthPersistableBusinessObject {
    private Long id;

    private String name;

    @Id
    @Column(name = "ID")
    @GeneratedValue(strategy = GenerationType.AUTO)
    @Documentation("Coluna de identificador.")
    public Long getId() {
        return this.id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    /**
     * @return nome do pai.
     */

    @Column(name = "NOME")
    @DisplayName("Nome")
    @Documentation("Coluna com o nome da entidade pai.")
    public String getName() {
        return this.name;
    }

    /**
     * Define o name.
     * 
     * @param name O name a ser definido.
     */

    public void setName(String name) {
        this.name = name;
    }

    @Override
    public String toString() {
        return "Pai(" + this.id + "," + this.name + ")";
    }
}